Sender: news@unx.sas.com (Noter of Newsworthy Events)
Organization: SAS Institute Inc.
Lines: 52
Originator: walker@twix.unx.sas.com
Nntp-Posting-Host: twix.unx.sas.com
In article <729632360.F00001@monly.wlink.nl>, Bart.Schraa@f115.n100.z60.wlink.nl (Bart Schraa) writes:
|> Hi,
|>
|> How do I actually auto open a system library with SAS/C 6.2. I tried some things which were stated in the manual. I only should do this wouldn't I?
|>
|> long oslibversion = 38L;
|>
|> struct Library *DOSBase;
|>
|> Then my program shouldn't run under V37, would it? I also tried the other one : 'long OSlibversion = 38L'. I linked all of these with c.o, but all attempts I did were running, but they really shouldn't.
|>
|> Maybe there is someone with a solution? Doug?
|>
|> Kind Regards, Bart.
Firstly, DOSBase is a special case. It is autoopened by the STARTUP
code, not by the autoinit code in the libraries. The startup code
doesn't look at __oslibversion. SysBase is the only other such
exception.
Secondly, NOTHING looks at oslibversion. The non-DOSBase code
looks at __oslibversion, though. The name is extremely important!
Thirdly, remember that if you want to autoinitialize a library
base, you cannot DEFINE it in your code, you can only DECLARE
it in your code. Therefore, you need to say
extern struct Library *IntuitionBase;
rather than
struct Library *IntuitionBase;
to tell the compiler that you want IntuitionBase to be autoinitialized.
Fourthly, the best way to initialize these library bases is to simply
#include the appropriate header:
#include <proto/intuition.h>
instead of trying to declare them in your own code.